Skip to content

Various fixes - #177

Open
metalinspired wants to merge 11 commits into
goetas-webservices:masterfrom
metalinspired:various_fixes
Open

Various fixes#177
metalinspired wants to merge 11 commits into
goetas-webservices:masterfrom
metalinspired:various_fixes

Conversation

@metalinspired

Copy link
Copy Markdown

Here is a list of changes I have made (hopefully I did not forget something):

  • Dropped support for PHP 7.
  • Fixed converting Any element. Since I actually do not need this element I only went so far to make the convertion work when this element is used. It seems to work fine, even wrote a test, but I'll let you be the judge of that.
  • Fixed few "visit" methods that were missing Choice and Group as child elements.
  • Fixed converting Choice that is inside of a GroupRef that has maxOccurs set to unbounded converted as property of that type instead being an array.
  • Fixed properties/methods duplicated in extending class.
  • Properties are now protected by default.
  • Return type hint is now "static" as some IDEs complain how methods do not exist in extending classes when it is set to "self".
  • Added support for "fixed" and "default" values. For "fixed" values, the setter still exists in PHP code but is not present in JMS definition. This was the simplest solution since I did not wanted to mess with PHP inheritance rules.
  • Added "strict_types" option to configuration.
  • Added types to properties/arguments/return values in some places.

Note that all my work is based on converting XZuFi 2.3.
So far everything seems to work as expected and soon I will be using generated classes and (de)serialization in customer code, which will in it self be a test if I broke something 😄

Oh and another thing, if you run the tests (all of them) it might happen that OTA tests fail but it seems that it is a bug in JMS as one interface defines "parse(): array" but class implementing it returns a string.

@goetas

goetas commented Nov 22, 2024

Copy link
Copy Markdown
Member

oh, this looks actually super great!!
On the other hand looks very hard to review... are your changes "per" commit?
Is there any chance you could split it into multiple pull requests?

@metalinspired

Copy link
Copy Markdown
Author

Turns out there was an issue I missed and caught when trying to serialize.
Some elements were being qualified when they should not have been.
It is fixed in last commit.
Unfortunately I have not been so tidy to do each change per commit.
The customer approved the time for me to fix the issues we were facing and I doubt I'll get the time (personal included) to split it into multiple PRs.
All I can tell you is that we are now getting classes as we would expect and they serialize just fine to XML which is then validated by another service, before they import it, and validation passes with a green light.

@metalinspired

metalinspired commented Nov 26, 2024

Copy link
Copy Markdown
Author

Also I removed removing the setter in JMS definition.
I figured it might break old code that implicitly set values for fields that are now populated with fixed/default data.

…rray

This behaviour caused the issue where one was unable to create a (empty)
object that does not have any elements inside the sequence.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants